package cn.zyq.ykb.controller.h5.course;

import cn.zyq.ykb.service.course.CourseService;
import cn.zyq.ykb.system.ry.util.poi.ExcelUtil;
import cn.zyq.ykb.system.common.BaseController;
import cn.zyq.ykb.system.annotation.Log;
import cn.zyq.ykb.system.ry.enums.BusinessType;
import cn.zyq.ykb.beans.course.Course;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import cn.zyq.ykb.system.common.BaseController;
import cn.zyq.ykb.system.common.PageParam;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 商学院课程Controller
 *
 * @author SystemAuth
 * @date 2023-05-19
 */

@RestController(value = "H5CourseController")
@RequestMapping("/api/course")
@Api(tags = "商学院课程接口")
public class CourseController extends BaseController {

    @Autowired
    private CourseService courseService;

    /**
     * 查询商学院课程列表
     */
    @ApiOperation(value = "列表", response = Course.class)
    @PostMapping("/list")
    public Object list(@RequestBody PageParam pageParam) {
        return this.courseService.selectCourseList(pageParam);
    }

    /**
     * 获取商学院课程详细信息
     */
    @ApiOperation(value = "详情", response = Course.class)
    @GetMapping(value = "/{courseID}")
    public Object getInfo(@PathVariable("courseID") Integer courseID) {
        return this.courseService.selectCourseByCourseID(courseID);
    }
    /**
     * 获取商学院课程详细信息
     */
    @ApiOperation(value = "详情", response = Course.class)
    @GetMapping(value = "/detail/{serviceID}")
    public Object getInfo(@PathVariable(value = "serviceID") String serviceID) {
        return this.courseService.selectCourseByServiceID(serviceID);
    }

}
